﻿
@{
    ViewBag.Title = "Pedido";
    var listaReporte = ViewBag.reporte as List<Vizzio.Models.ReportePedido>;
}

<h2><strong>Reporte de Pedido</strong></h2>

<form class="form-inline" method="post" action="/Pedido/ReporteBuscar" role="form">
    <fieldset>
        <legend>Seleccione el rango de fechas y el Nº de pedido : </legend>
        <div class="form-group col-md-3">
            <div class='input-group date' id='datetimepicker8'>
                <span class="input-group-addon"><i class="glyphicon glyphicon-th"></i></span>
                <input type='text' id="FechaInicial" name="FechaInicial" class="form-control" readonly placeholder="Fecha Inicial"/>
            </div>
        </div>
        <div class="form-group col-md-3">
            <div class='input-group date' id='datetimepicker9'>
                <span class="input-group-addon"><i class="glyphicon glyphicon-th"></i></span>
                <input type='text' id="FechaFinal" name="FechaFinal" class="form-control" readonly placeholder="Fecha Final"/>
            </div>
        </div>
        <div class="form-group col-md-2">
            <div class="form-group">
                <input type="text" class="form-control" id="numeroPedido" name="idPedido" placeholder="Nº de pedido" >
            </div>
        </div>
        <div class="form-group col-md-4">
            <button type="submit" class="btn btn-primary btn-sm form-group" id="btnBuscar"><span class="glyphicon glyphicon-search"></span> Buscar</button>
        </div>
        </fieldset>
</form>

<table class="table table-striped table-hover ">
    <thead>
        <tr>
            <th>Nº de Pedido</th>
            <th>Fecha de Ingreso de Pedido</th>
            <th>Fecha de Despacho de pedido</th>
            <th>Estado De pedido</th>
            <th>Pedido De </th>
        </tr>
    </thead>
    <tbody>
        @foreach (var item in listaReporte)
        {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.idPedido)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.fechaIngresoPedido)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.fechaDespachoPedido)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.estado)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.tipoDePedido)
                </td>
            </tr>
        }

    </tbody>
</table>
@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
    <script type="text/javascript">

        $('#datetimepicker8.input-group.date').datepicker({
            format: "dd/mm/yyyy",
            weekStart: 1,
            language: "es",
            autoclose: true
        });

        $('#datetimepicker9.input-group.date').datepicker({
            format: "dd/mm/yyyy",
            weekStart: 1,
            language: "es",
            autoclose: true
        });
        $("#datetimepicker8.input-group.date").on("dp.change", function (e) {
            $('#datetimepicker9').data("DateTimePicker").setMinDate(e.date);
        });
        $("#datetimepicker9.input-group.date").on("dp.change", function (e) {
            $('#datetimepicker8').data("DateTimePicker").setMaxDate(e.date);
        });


    </script>

}


